package com.tduck.cloud.api.web.controller.system;

import com.tduck.cloud.common.util.Result;
import com.tduck.cloud.security.service.SysRegisterService;
import com.tduck.cloud.system.request.RegisterRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户注册
 *
 * @author tduck
 */
@RestController
@RequiredArgsConstructor
public class SysRegisterController {
    private final SysRegisterService registerService;

    /**
     * 账号注册
     * @param request 请求参数
     * @return 是否成功
     */
    @PostMapping("/register")
    public Result register(@Validated  @RequestBody RegisterRequest request) {
        return registerService.register(request);
    }
}
